Skip to content

Instantly share code, notes, and snippets.

View twicejr's full-sized avatar

twicejr

View GitHub Profile
@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@brickpop
brickpop / FSWrapper.js
Last active August 29, 2015 14:02
Phonegap File API JS Wrapper
// Wrapping of the example found on https://gist.github.com/alunny/1904992
// Jordi Moraleda
// This example works on org.apache.cordova.file version 1.1.0 and 1.2.0
//
// If you are using version 1.3.0, check out the file below
// https://gist.github.com/jmoraleda/78551f439578f7c132c8#file-fswrapper-v1-3-js
function FSWrapper(options, callback) {
var self = this;
@Divi
Divi / compile-php-thread-safe-and-pthreads.sh
Last active May 19, 2021 00:43
Compile PHP Thread Safe & pthreads extension
#!/usr/bin/env bash
# PARAMETERS
# ----------
# PHP
# ---
PHP_TIMEZONE="UTC"
PHP_DIRECTORY="/etc/php5ts"
@EmmanuelKasper
EmmanuelKasper / EFI boot on Lenovo Thinkcenter M92Z
Last active February 14, 2023 13:02
EFI boot on Lenovo Thinkcenter M92Z
# disable secure boot in the bios, in menu security
# downlad and unzip refind-bin-0.7.8.zip
# install refind, assuming your ESP partition is /dev/sda1 and mounted in /boot/efi
cd refind-bin-0.7.8
./install.sh
# type y and go ahead
# at that time your boot entry should look like that
@mmstick
mmstick / Ubuntu Kernel Upgrader Script
Last active March 11, 2023 04:53
Asks the user whether they want to install the latest RC or stable, then downloads the correct kernel and installs it.
#!/bin/bash
cd /tmp
if ! which lynx > /dev/null; then sudo apt-get install lynx -y; fi
if [ "$(getconf LONG_BIT)" == "64" ]; then arch=amd64; else arch=i386; fi
function download() {
wget $(lynx -dump -listonly -dont-wrap-pre $kernelURL | grep "$1" | grep "$2" | grep "$arch" | cut -d ' ' -f 4)
}
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active April 2, 2024 02:45
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active February 2, 2023 15:17
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@cybear
cybear / raspberry_pi_optimization.md
Last active January 27, 2023 22:17
I read up a little on performance optimization for the Raspberry Pi, and gathered the links before they disappear from my short term memory.

Raspberry Pi general optimization

  • Use a class 10 SD card for best speed. The USB bus can't come much higher than 30MB/s so you don't have to buy any extremely fast ones though. Not all cards are compatible, check the compatibility list: http://elinux.org/RPi_SD_cards
  • Use the HardFloat version of Raspbian instead of the SoftFloat. HF has much faster floating point operations - however SF is required for running Java. So it's either Java or performance, like normal.
  • The official Raspbian image gives low network speeds: http://elinux.org/RPi_Performance#NIC
  • A graphics driver by Simon / teh_orph is using hardware acceleration for some instructions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=28294 installation instructions: http://elinux.org/RPi_Xorg_rpi_Driver
  • The firmware can be upgraded which gives, among other things, better GPU performance.
@jayj
jayj / flexbox.less
Last active November 20, 2023 04:51
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox
@ravishi
ravishi / ubuntu-post-install.sh
Last active November 8, 2019 12:02
My post install script for Ubuntu
#!/bin/bash
# TODO
# - Automatically fix the "Unknown display" problem by editing grub defaults
# like described here: http://askubuntu.com/questions/398903/unknown-display-besides-laptop-built-in-display-old-question-but-with-no-answer
##
## Essential stuff
##
sudo apt-get install -y build-essential aria2 git mercurial subversion \