Skip to content

Instantly share code, notes, and snippets.

View isc30's full-sized avatar
💭
:trollface:

Ivan Sanz Carasa isc30

💭
:trollface:
View GitHub Profile
@Ghostnipple
Ghostnipple / Bustabit Results History
Last active January 12, 2022 08:59
This script will generate past game results for Bustabit. Copy the script below and paste it in to a new script window on bustabit. Please note this version only generates the past results, not future results. The save to file option has never worked for me. Script produced by Dsetzer (original can be found at https://gist.github.com/dsetzer.)
//Script was produced by Dsetzer original can be found at https://gist.github.com/dsetzer
//In the script panel in Bustabit create a new script. Copy the script below and paste it in to the script window on bustabit.
//Please note this version will only give you past results and not future results.
//The script has a save to file option, but this has never worked for me.
var config = {
span: { label: 'Previous Games', type: 'number', value: '100' },
outh: { label: 'Include Hashes', type: 'checkbox', value: false },
ocsv: { label: 'Download CSV', type: 'checkbox', value: true}
};
@tvler
tvler / hoc.tsx
Last active November 7, 2021 01:06
A type-safe high-order-component creator that injects a prop named a given string, with a type inferred by a given hook's return value.
/**
* A type-safe high-order-component creator
* that injects a prop named a given string,
* with a type inferred by a given hook's
* return value.
*
* Ex:
* const Component = ({ name }) => {
* return <>Hello {name}</>;
* };
@lostpebble
lostpebble / pullstate-local-storage.ts
Created August 20, 2019 14:56
One way to create a local storage solution with Pullstate
import { Store } from "pullstate";
import { LocalStorage } from "@gt/gt-frontend/build/localStorage/LocalStorage";
import { get, pick, set } from "lodash";
interface IStoreWithValues<S> {
key: string;
store: Store<S>;
values?: Array<keyof S>;
deepValues?: string[];
}
@lefticus
lefticus / iife.cpp
Last active July 13, 2021 15:01
Immediately-invoked Function Expressions in C++
#include <chrono>
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
std::string to_string(const int i)
{
std::stringstream ss;
ss << i;
@isc30
isc30 / install.bash
Last active January 27, 2021 10:38
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release
@Lewiscowles1986
Lewiscowles1986 / rPi3-php7-setup.sh
Last active November 8, 2019 00:17
Raspberry Pi PHP7, Nginx 1.9 Installer
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
#include <iostream>
#include <vector>
#include <type_traits>
#include <tuple>
namespace sfinae
{
using success = std::true_type;
using fail = std::false_type;
@usagi
usagi / emscripten_run_script_with_web_storage.cxx
Created May 11, 2014 06:18
Hello, Filesystem or Web Local Storage! with emscripten_run_script_string version.
#include <iostream>
#include <fstream>
#include <string>
#ifdef EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
namespace
{
@rolandoam
rolandoam / Makefile
Created March 19, 2013 19:15
makefile for both native and emscripten projects: make js # will make the js port, output a projectname.js make native # will compile the native port, output project.native make sure there are no important files named `project.*` because they will be cleaned by the `clean` target
EMSCRIPTEN_HOME = ~/Documents/inbox/emscripten
PROJECT = myproject
SOURCES = $(wildcard *.cc) $(wildcard *.c)
OBJECTS = $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))
set-native:
$(eval CXX := clang -x c++)
$(eval CC := clang)
$(eval CPPFLAGS := -g -O2 -DHAS_TR1)
@isc30
isc30 / installArsys.bash
Last active July 25, 2016 01:39
Install DnsUpdater for Arsys
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
apt-get update -y
apt-get install -t stretch -y php7.0-soap
apt-get autoremove -y