Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Python Lisp S-Expression interpreter | |
# | |
# Example: | |
# ./pylisp.py "(+ (* 2 3) 1)" executes (2 * 3) + 1 and yields 7 | |
# | |
# currently only + - / + and = are supported operations | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <sys/ioctl.h> | |
#include <unistd.h> | |
#include "hwio.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <dirent.h> | |
#include <stdio.h> | |
void ls(char *path) | |
{ | |
DIR *dir; | |
struct dirent *file; | |
dir = opendir(path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <sys/mman.h> | |
#include <sys/ioctl.h> | |
#include <fcntl.h> | |
#include <stdint.h> | |
#include <unistd.h> | |
#include "genode.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
FILE *fp = fopen(argv[1], "rb"); | |
if(!fp) return 1; | |
int last = 0, bigdiff = 0, num; | |
while(fscanf(fp, "%d", &num) > 0){ | |
if((num - last) > bigdiff) { | |
printf("Overthrow: %#x > %#x (%#x-%#x)\n", num-last, bigdiff, last, num); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Intel ACPI Component Architecture | |
* AML/ASL+ Disassembler version 20160831-64 | |
* Copyright (c) 2000 - 2016 Intel Corporation | |
* | |
* Disassembling to symbolic ASL+ operators | |
* | |
* Disassembly of DSDT, Fri May 12 09:26:31 2017 | |
* | |
* Original Table Header: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
kernels=$(dpkg -l | grep -E "ii linux-(image|headers)-[0-9]\.[0-9]\.[0-9]-.*" | grep -v $(uname -r | cut -d"-" -f1,2) | cut -d" " -f3) | |
echo "Current kernel: $(uname -r)" | |
echo "Remove kernels:" | |
echo "$kernels" | |
read -p "Execute? (y/n)" choice | |
if [ "$choice" == "y" ] | |
then | |
echo $kernels | xargs sudo apt-get remove -y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import psycopg2 as psql | |
from sys import argv | |
import configparser | |
import os | |
from urllib.parse import urlparse | |
from tqdm import tqdm | |
import csv |
NewerOlder