Skip to content

Instantly share code, notes, and snippets.

View fxfactorial's full-sized avatar
🎯
Focusing

@edgararout fxfactorial

🎯
Focusing
View GitHub Profile
@ciaranj
ciaranj / gist:9056285
Created February 17, 2014 18:32
A *working* (on Windows) UDP Multicast client & server with Node.Js v0.10.25 (I spent a *LOT* of time getting EINVAL and I still don't quite know why :/)
For my own sanity ;) Scraped from a variety of places, including: http://stackoverflow.com/questions/14130560/nodejs-udp-multicast-how-to?utm_medium=twitter&utm_source=twitterfeed
!Server
var news = [
"Borussia Dortmund wins German championship",
"Tornado warning for the Bay Area",
"More rain for the weekend",
"Android tablets take over the world",
"iPad2 sold out",
@jordwalke
jordwalke / myComponent.ml
Last active December 13, 2021 17:32
React OCaml API
open ReactDOM
module MyComponent = struct
(* Component Properties *)
type props = {count: int}
(* Hey, state can be any type! *)
type state = string
(* Initializer *)
@chaitanyagupta
chaitanyagupta / re-sign-ios-app.md
Last active October 20, 2023 08:28
How to re-sign an iOS app with another developer account

WARNING These steps are probably out dated and will not work.

To re-sign an iOS app with another developer account, ensure that the following are in place first.

  1. Distribution certificate of the other developer account
  2. A provisioning profile from the other developer account

Note that the Apple requires bundle IDs to be globally unique, even across accounts. So a bundle ID i.e. CFBundleIdentifier from one account can't be used in a different account, even though the team id/prefix would be different.

Ensure that the new distribution certificate is in your keychain and the new provisioning profile on your disk.

@rishabhmhjn
rishabhmhjn / executeShellInGradle
Created November 5, 2014 07:26
Executing shell commands and getting output in gradle
def getVersionName = { ->
def hashStdOut = new ByteArrayOutputStream()
exec {
commandLine "git", "rev-parse", "--short", "HEAD"
standardOutput = hashStdOut
}
def buildNumberStdOut = new ByteArrayOutputStream()
exec {
commandLine 'echo', "$BUILD_NUMBER"
@cswiercz
cswiercz / simple.py
Last active May 14, 2023 01:07
A quick demonstration of how to plot multivalued complex functions in Python.
import numpy
import sympy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
from matplotlib import cm, colors
from matplotlib import pyplot as plt
branching_number = 2
@jtbonhomme
jtbonhomme / nc.md
Last active May 9, 2024 18:44
Using Netcat for File Transfers

Netcat is like a swiss army knife for geeks. It can be used for just about anything involving TCP or UDP. One of its most practical uses is to transfer files. Non *nix people usually don't have SSH setup, and it is much faster to transfer stuff with netcat then setup SSH. netcat is just a single executable, and works across all platforms (Windows,Mac OS X, Linux).

Destination

On the receiving (destination) terminal, run:

nc -l -p 1234 > out.file 

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).

@filewalkwithme
filewalkwithme / main.go
Last active February 16, 2024 23:22
Listening multiple ports on golang http servers (using http.Handler)
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@parente
parente / postinstall.sh
Last active April 23, 2024 06:11
Post-install script to disable SSH password authentication, install latest Docker with AUFS on Ubuntu 14.04 VMs
#!/bin/bash
# Disable password authentication
sudo grep -q "ChallengeResponseAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*ChallengeResponseAuthentication[[:space:]]yes.*/c\ChallengeResponseAuthentication no" /etc/ssh/sshd_config || echo "ChallengeResponseAuthentication no" >> /etc/ssh/sshd_config
sudo grep -q "^[^#]*PasswordAuthentication" /etc/ssh/sshd_config && sed -i "/^[^#]*PasswordAuthentication[[:space:]]yes/c\PasswordAuthentication no" /etc/ssh/sshd_config || echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
sudo service ssh restart
# Install latest Docker
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
@jcalvert
jcalvert / gist:542d4fb98c321f024256
Last active December 28, 2019 22:51
To Install libwkhtmltox

##To Install libwkhtmltox

  • Clone the wkhtmltopdf repo git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git
  • You need the fpm gem to install sudo gem install fpm --no-ri --no-rdoc - it will be installed in /usr/bin so make sure that's in your path.
  • Checkout the latest release tag IE git checkout tags/0.12.2.
  • In the directory and run scripts/build.py osx-cocoa-x86-64(this will take a while! You're building Qt)
  • If you get an error like: error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: can't open file: bin/libwkhtmltox.0.12.2.2.dylib (No such file or directory) all you need to do is match the version in the VERSION file in the base directory to the number between libwkhtmltox. and .dylib of the compiled file in static-build/osx-cocoa-x86-64/app/bin
  • If you're not on OS X, refer to INSTALL.md in the wkhtmltopdf repo for build instructions.