Skip to content

Instantly share code, notes, and snippets.

View zlatnaspirala's full-sized avatar

Nikola zlatnaspirala

View GitHub Profile
@innat
innat / DotMultiply.md
Last active September 6, 2024 21:38
In Python np.dot and np.multiply with np.sum
@suizokukan
suizokukan / buildozer.spec
Last active April 12, 2025 18:47
buildozer.spec : simple file to test the installation of Kivy+Buildozer (python3 project, target : ARM)
##############################################################################
# about buildozer.spec : https://buildozer.readthedocs.io/en/latest/specifications.html
##############################################################################
[app]
# (str) Title of your application
title = induperator
# (str) Package name
@barneycarroll
barneycarroll / unfuckReact.js
Last active September 2, 2022 14:37
React components are so fucking stupid, it's unbelievable. 3 months with this library version 15 and the glaring stupidity of the API just keeps coming in waves. Fixing some of this stuff – just for the sake of internal consistency – would have been so simple. The number of hoops you're required to jump through for trivial shit. Ugh.
const mounted = new WeakSet()
export default (component, displayName = component.displayName || component.name || 'React.Component') => {
const host = {
[displayName] : class extends React.Component {
constructor(){
this.state = {}
component.apply(this, arguments)
}
@fffaraz
fffaraz / portscanner.c
Last active July 31, 2024 17:57
Port scanner code in c
#include "stdio.h"
#include "sys/socket.h"
#include "errno.h"
#include "netdb.h"
#include "string.h"
#include "stdlib.h"
int main(int argc , char **argv)
{
struct hostent *host;
<script>
function test(){
d=document;
d.body.appendChild(c=d.createElement("canvas"));
g=c.getContext("webgl")||c.getContext("experimental-webgl");
sp=g.createProgram();
function gs(t,s){
g.shaderSource(t=g.createShader(t),s);
g.compileShader(t);g.attachShader(sp,t);
}
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@dustinfarris
dustinfarris / list.kv
Last active February 20, 2021 17:40
Dynamic lists in Kivy
#:import la kivy.adapters.listadapter
#:import listview kivy.uix.listview
<MyList>:
adapter: la.ListAdapter(
data=[],
args_converter=self.list_item_args_converter,
cls=listview.ListItemButton)
<MyScreen>:
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done