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 | |
source $(dirname $0)/config | |
USED=$(ps -eo pcpu | awk 'BEGIN {sum=0.0f} {sum+=$1} END {print sum}') | |
output="%{F$COLOR_ICON} %{F-}$USED" | |
echo $output $DIV; |
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
package utils; | |
// From https://github.com/nadako/HaxeDungeons/blob/master/src/dungeons/utils/Grid.hx | |
class Vector2D<T> | |
{ | |
public var width(default, null):UInt; | |
public var height(default, null):UInt; | |
private var grid:Array<T>; |
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/sh | |
# Program to use the command install recursivly in a folder | |
magic_func() { | |
echo "entering ${1}" | |
echo "target $2" | |
for file in $1; do | |
if [ -f "$file" ]; then |
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/sh | |
echo "Current MAC address" | |
MAC=`ip link show wlp2s0 | awk '/ether/ {print $2}'` | |
echo $MAC | |
MAC=`echo $MAC | cut -d: -f1-3` | |
echo "Building new MAC address" |
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
struct Node<T> | |
{ | |
id: u32, | |
data: T, | |
left: Option<Box<Node<T>>>, | |
right: Option<Box<Node<T>>>, | |
parent: Option<Box<Node<T>>>, | |
} | |
struct Tree<T> |
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
// Example program | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
template<typename T> | |
void print(std::vector<T>& v) | |
{ | |
for(auto it : v) |
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 <csignal> | |
#include <iostream> | |
#include <thread> | |
namespace | |
{ | |
volatile std::sig_atomic_t gSignalStatus = 0; | |
} | |
class Foo |
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 <iostream> | |
#include <cstring> | |
int main() | |
{ | |
float* biga = new float[6]; | |
float* a = new float[3]; | |
a[0] = 1.0f; | |
a[1] = 1.0f; |
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 <string> | |
#include <vector> | |
#include <tuple> | |
#include <iostream> | |
#include <experimental/tuple> | |
#define HI std::cout << __PRETTY_FUNCTION__ << '\n'; | |
template <class Sig> | |
struct MsgQueue; |
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 <iostream> | |
#include <vector> | |
#include <string> | |
#include <memory> | |
struct Foo | |
{ | |
Foo(int size) : words(size, "Foo") | |
{} | |
OlderNewer