Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
:trollface:

Ivan Sanz Carasa isc30

💭
:trollface:
View GitHub Profile
@isc30
isc30 / installArsys.bash
Last active Jul 25, 2016
Install DnsUpdater for Arsys
View installArsys.bash
#!/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
@rolandoam
rolandoam / Makefile
Created Mar 19, 2013
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
View Makefile
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)
@usagi
usagi / emscripten_run_script_with_web_storage.cxx
Created May 11, 2014
Hello, Filesystem or Web Local Storage! with emscripten_run_script_string version.
View emscripten_run_script_with_web_storage.cxx
#include <iostream>
#include <fstream>
#include <string>
#ifdef EMSCRIPTEN
#include <emscripten/emscripten.h>
#endif
namespace
{
View conceptsV2.cpp
#include <iostream>
#include <vector>
#include <type_traits>
#include <tuple>
namespace sfinae
{
using success = std::true_type;
using fail = std::false_type;
@Lewiscowles1986
Lewiscowles1986 / rPi3-php7-setup.sh
Last active Nov 8, 2019
Raspberry Pi PHP7, Nginx 1.9 Installer
View rPi3-php7-setup.sh
#!/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
@isc30
isc30 / install.bash
Last active Jan 27, 2021
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
View install.bash
#!/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
@lefticus
lefticus / iife.cpp
Last active Jul 13, 2021
Immediately-invoked Function Expressions in C++
View iife.cpp
#include <chrono>
#include <string>
#include <sstream>
#include <vector>
#include <iostream>
std::string to_string(const int i)
{
std::stringstream ss;
ss << i;
@lostpebble
lostpebble / pullstate-local-storage.ts
Created Aug 20, 2019
One way to create a local storage solution with Pullstate
View pullstate-local-storage.ts
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[];
}
@vittorioromeo
vittorioromeo / hello_triangle.cpp
Created Oct 10, 2015
SDL2 + OpenGL ES 2.0 - "Hello triangle" example that works both on X11 and Emscripten
View hello_triangle.cpp
#include <exception>
#include <functional>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
@tvler
tvler / hoc.tsx
Last active Nov 7, 2021
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.
View hoc.tsx
/**
* 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}</>;
* };