Skip to content

Instantly share code, notes, and snippets.

🤹‍♂
Juggling

Kumar Harsh kumarharsh

🤹‍♂
Juggling
Block or report user

Report or block kumarharsh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View upx.strace
9669 execve("./upx64/upx", ["./upx64/upx"], 0x7fffda4bdab8 /* 21 vars */) = -1 ENOEXEC (Exec format error)
9669 write(2, "strace: exec: Exec format error\n", 32) = 32
9669 getpid() = 9669
9669 exit_group(1) = ?
9669 +++ exited with 1 +++
@kumarharsh
kumarharsh / git-repro.sh
Created Nov 21, 2017
Reproduce bug in Git Log using this script (git-for-windows)
View git-repro.sh
#!/usr/bin/env bash
set -x
rm -rf test-repo
rm -rf test-submodule
mkdir test-submodule
pushd test-submodule
@kumarharsh
kumarharsh / update_schema.go
Created Feb 20, 2017
Build schema.json from Graphql mutations & queries using playlyfe/go-graphql
View update_schema.go
package main
import (
"flag"
"io/ioutil"
"github.com/playlyfe/go-graphql"
gql "github.com/your-project/your-graphql-mutations-and-queries"
)
@kumarharsh
kumarharsh / update_schema.go
Created Feb 20, 2017
Build schema.json from Graphql mutations & queries using playlyfe/go-graphql
View update_schema.go
package main
import (
"flag"
"io/ioutil"
"github.com/playlyfe/go-graphql"
gql "github.com/your-project/your-graphql-mutations-and-queries"
)
@kumarharsh
kumarharsh / gen-schema.js
Created Feb 10, 2017
Generate schema.js from .gql files
View gen-schema.js
/* @flow */
import generate from '@playlyfe/gql/lib/tools/generate';
import path from 'path';
import fs from 'fs';
// This script reads in the schema files based off the configOptions.cwd folder
// and generates a schema.js (instead of schema.json) file and
// outputs it to the specified output folder
// Usually, you'd place this script just before running webpack,
@kumarharsh
kumarharsh / Select.jsx
Last active Jul 3, 2018
Shows how to use react-select with portals provided by react-overlay
View Select.jsx
import ReactSelect from 'react-select';
import Portal from 'react-overlays/lib/Portal';
import 'react-select/dist/react-select.css'; // I'm using css-modules, but you can use whatever you like
import css from './Select.css';
import defaultMenuRenderer from 'react-select/lib/utils/defaultMenuRenderer'; // this renders the actual menu - we can reuse the same component
class _SelectMenu extends React.Component {
props: { // flow types
selectProps: {},
@kumarharsh
kumarharsh / system-environment-snippets
Last active Mar 20, 2018
[Powershell] Update Environment Variable one-liner
View system-environment-snippets
# These snippets provide a quick way to update your environment variables
# directly from your powershell console. Just copy paste these lines, or
# even better, add it to your profile as functions.
# refreshing env in current shell
$env:path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User")
# adding path to env
# set path in the $_newPath variable, and it'll get set to your user environment path and persisted.
$_newPath=""; [System.Environment]::SetEnvironmentVariable("Path", [System.Environment]::GetEnvironmentVariable("Path", "User") + ";${_newPath}", "User")
@kumarharsh
kumarharsh / twitter-widgets.coffee
Last active Aug 29, 2015
Twitter Widgets in AngularJS
View twitter-widgets.coffee
# A way to use twitter widgets with angularjs
YOUR_MODULE
.directive('plTwitterButton', ['$timeout', ($timeout) ->
replace: true
template: """
<a class="twitter-share-button"
href="{{ href }}"
data-url="{{ url }}"
data-text="{{ text }}"
@kumarharsh
kumarharsh / daft.txt
Created Sep 3, 2014
ubuntu-weirdness
View daft.txt
Aerodynamic (instrumental)
Around the World (Daft Punk song)
Burnin' (instrumental)
Contact (Daft Punk song)
Da Funk
Derezzed
Digital Love
Doin' It Right
Face to Face (Daft Punk song)
Fragments of Time
@kumarharsh
kumarharsh / chai-as-promised-webdriver-test.js
Last active Jan 2, 2016
A gist to track down an error in selenium-webdriver tests using chai-as-promised + mocha
View chai-as-promised-webdriver-test.js
describe("test the UI", function() {
it('when the log is shown', function(next) {
var _this = this;
var promiseA, promiseB;
promiseA = Q.promise() // or whatever, to create a promise for this test
promiseB = Q.promise() // or whatever, to create a promise for this test
promiseA.then(function() { // promiseA and promiseB are Q promises
var fn;
fn = function(limit) {
return promiseB.then(function(data) {
You can’t perform that action at this time.