Skip to content

Instantly share code, notes, and snippets.

View XenHat's full-sized avatar
🎩

XenHat XenHat

🎩
  • Quebec, Canada
  • 21:18 (UTC -04:00)
  • X @XenHat
View GitHub Profile
@natyusha
natyusha / userchrome.css
Last active November 2, 2017 21:27
nightly css / pre australis DEPRECATED
/*
Based on ahoka's Firefox CSS for linux
expanded upon by masood // twnsnd
browser.tabs.onTop should be set to false in about.config
*/
/* HIDDEN ELEMENTS */
#identity-box,
#urlbar-container dropmarker,
#tabbrowser-tabs .scrollbutton-up,
@sym3tri
sym3tri / GH-WS-Ignore
Created April 6, 2012 19:42
Bookmarklet to quickly ignore whitespace in github diffs
javascript:(function() { window.location.href += '?w=1';})();
@xeoncross
xeoncross / dd.pv.sh
Created June 7, 2012 14:56
Clone hard drive on linux with DD and PV
When using the linux utility dd, there is no visual output of the progress, how long it is going to take, or anything else. Easy to solve with the use of pv:
% sudo fdisk -l
% pv /dev/sda | dd of=/dev/sdb bs=100M
that’ll display the amount of data transferred, the elapsed time, the throughput speed, a nice progress bar, and the ETA. For devices that do not have a fixed size, let’s say, /dev/zero, there’ll be only a throughput display.
- http://www.yournearestbar.com/2011/10/monitoring-dd-with-a-progress-bar/
@zchothia
zchothia / avx_dispatch_example.c
Created July 9, 2012 21:13
AVX CPU dispatching - based on Agner Fog's C++ vector class library [http://www.agner.org/optimize/vectorclass.zip]
// AVX CPU dispatching - based on Agner Fog's C++ vector class library:
// http://www.agner.org/optimize/vectorclass.zip
#include <stdio.h>
#include <stdbool.h>
//------------------------------------------------------------------------------
//>> BEGIN <instrset.h>
// Detect 64 bit mode
@cbsmith
cbsmith / random_selection.cpp
Last active August 9, 2022 12:29
Hopefully serves as a reference implementation on how to do random selection of an element from a container.
// -*- compile-command: "clang++ -ggdb -o random_selection -std=c++0x -stdlib=libc++ random_selection.cpp" -*-
//Reference implementation for doing random number selection from a container.
//Kept for posterity and because I made a surprising number of subtle mistakes on my first attempt.
#include <random>
#include <iterator>
template <typename RandomGenerator = std::default_random_engine>
struct random_selector
{
//On most platforms, you probably want to use std::random_device("/dev/urandom")()
@esetomo
esetomo / Rakefile
Created August 15, 2013 11:34
SecondLife Viewerコンパイル用。CP932でエラーになる部分の修正とか。
# -*- mode: ruby; encoding: utf-8 -*-
require 'albacore'
require 'win32/shortcut'
task :default => :shortcut
BUILD_DIR='viewer-local'
ENV['LANG'] = 'C'
@larrybolt
larrybolt / cf-ddns.sh
Last active June 16, 2024 19:06
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@shsteimer
shsteimer / gist:7257245
Created October 31, 2013 21:10
Tip to delete tags by pattern
#delete all the remote tags with the pattern your looking for, ie. DEV-
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/%
#delete all your local tags
git tag | xargs -n 1 -i% git tag -d %
#fetch the remote tags which still remain
git fetch
@charles-hollenbeck
charles-hollenbeck / cloudflareippoint.rb
Last active August 7, 2016 00:54
Change all of the A records in your cloudflare account to point at a new IP
#!/usr/bin/env ruby
# Change all of the A records in your cloudflare account to point at a new IP
# chmod +x file.rb;./file.rb to run
# Example command: ./file.rb <ip> or let it prompt you
require 'cloudflare' # Laziness at it's best; Source: https://github.com/B4k3r/cloudflare
# Just some coloring crap
class String
def colorize(color_code); "\e[#{color_code}m#{self}\e[0m" end
@hi2p-perim
hi2p-perim / ssecheck.cpp
Last active June 16, 2024 06:55
Check SSE/AVX instruction support.
/*
Check SSE/AVX support.
This application can detect the instruction support of
SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4a, SSE5, and AVX.
*/
#include <iostream>
#ifdef _MSC_VER
#include <intrin.h>
#endif