Skip to content

Instantly share code, notes, and snippets.

@pedramamini
pedramamini / XProtect.yara
Created October 19, 2017 20:18
Apple OSX built in file defense is powered by YARA: /System/Library/CoreServices/XProtect.bundle/Contents/Resources
import "hash"
private rule Macho
{
meta:
description = "private rule to match Mach-O binaries"
condition:
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca
}
@the-nose-knows
the-nose-knows / csharp_7point1orlater_asyncmain_countdowntimer.cs
Last active May 1, 2024 14:38
A countdown timer written in C# 7.1+ using an async main method and an async task delay
using System;
using System.Threading.Tasks;
namespace CountdownTimer
{
class Program
{
public static async Task Main( string[] args )
{
int delay = 500; // Default delay
@shinzui
shinzui / tmux.conf
Created March 12, 2011 01:08 — forked from bryanl/tmux.conf
tmux.conf
# ~/.tmux.conf
#
# See the following files:
#
# /opt/local/share/doc/tmux/t-williams.conf
# /opt/local/share/doc/tmux/screen-keys.conf
# /opt/local/share/doc/tmux/vim-keys.conf
#
# URLs to read:
#
@chranderson
chranderson / nvmCommands.js
Last active May 1, 2024 14:36
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@lasagnaphil
lasagnaphil / build_libtorch.sh
Last active May 1, 2024 14:36
Build libtorch from scratch
# Script for installing libtorch from scratch (without any python dependencies)
# This clones the ``pytorch`` folder in the current directory, creates a ``pytorch-build`` directory containing all the intermediate files for building, and creates a ``pytorch-install`` folder for storing the compiled library.
# After the build, you can use it by setting ``CMAKE_PREFIX_PATH=(path to pytorch-install folder)``.
# Note that you need to have all the dependencies needed before running this script! (Read README.md in the main pytorch repo)
git clone --recursive https://github.com/pytorch/pytorch -b v1.7.1 --depth 1
mkdir -p pytorch-build
mkdir -p pytorch-install
pushd pytorch-build
@rxaviers
rxaviers / gist:7360908
Last active May 1, 2024 14:35
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@mabenson00
mabenson00 / cheatsheet.rb
Last active May 1, 2024 14:35
Rails ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 1, 2024 14:35
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@apizz
apizz / Install_AirPrint_Printer.sh
Last active May 1, 2024 14:34
Programmatically adds an AirPrint printer, ideally with an icon
#!/bin/bash
# Use the built-in ipp2ppd tool to create a PPD file for AirPrint
# Add icon to PPD (if we can get one) and install the printer
# Required printer info
readonly PRINTER_IP='XXX.XXX.XXX.XXX'
readonly PRINTER_NAME='PRINTER_NAME'
readonly PRINTER_DISPLAY_NAME='PRINTER NAME'
readonly PRINTER_LOCATION='PRINTER LOCATION'
@Gordin
Gordin / cd_for_windows_paths.sh
Last active May 1, 2024 14:32
If you put this in your .bashrc/.zshrc you will be able to use cd to Windows style paths. This is probably only useful for WSL users.
cd() {
# Check if no arguments to make just typing cd<Enter> work
# Also check if the first argument starts with a - and let cd handle it
if [ $# -eq 0 ] || [[ $1 == -* ]]
then
builtin cd $@
return
fi
# If path exists, just cd into it
# (also, using $* and not $@ makes it so you don't have to escape spaces any more)