Skip to content

Instantly share code, notes, and snippets.

View maksadbek's full-sized avatar
💭
Chilling

Maksadbek maksadbek

💭
Chilling
View GitHub Profile
#include <iostream>
using namespace std;
class Test{
private:
~Test(){
cout<<"destroying..."<<endl;
}
@maksadbek
maksadbek / gist:6854145
Created October 6, 2013 13:35
Printing "Geeksforgeeks" with empty main()
#=========================#
#====With GCC compiler====#
#=========================#
#include <iostream>
using namespace std;
void reveal()__attribute__((constructor));
void reveal(){
#include <iostream>
#include <signal.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
void sigintHandler(int sig_num){
signal(SIGINT, sigintHandler);
printf("\n Connot be terminated, haha\n");
fflush(stdout);
@maksadbek
maksadbek / gist:6854747
Created October 6, 2013 14:28
String length without strlen, printf and sizeof
#include <stdio.h>
typedef void (*fptr)(char* pString, int* pLen);
void istringlength(char* pString, int* pLen);
void pstringlength(char* pString, int* pLen);
fptr pFunc[2] = {istringlength, pstringlength};
void istringlength(char* pString, int* pLen) {
@maksadbek
maksadbek / urls
Last active December 25, 2015 01:39
http://net.tutsplus.com/tutorials/ruby/gem-creation-with-bundler/
http://guides.rubygems.org/make-your-own-gem/
http://net.tutsplus.com/tutorials/building-ribbit-in-scala/
http://www.instructables.com/id/How-to-Make-an-Auto-Hacking-USB-Drive/
for i to n
min = i
for j=i+1 to n
if( A[min] > A[j])
min = j
end
end
swap(A[min], A[j])
end
Public Class Form1
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles tbxIn.TextChanged
End Sub
Private Sub btnTr_Click(sender As Object, e As EventArgs) Handles btnTr.Click
Dim textInput As String = tbxIn.Text
Dim len As Integer = textInput.Length
'Cruel Games
Public Class Form1
Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
If (rbnLess.Checked) Then
MsgBox("sorry, you are too young, GTFO please")
ElseIf (rbnBetween.Checked) Then
MsgBox("Let's party rock")
Else
@maksadbek
maksadbek / tut4
Last active December 27, 2015 01:19
'even & odd
Public Class Form1
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar >= ChrW(Keys.D0) And e.KeyChar <= ChrW(Keys.D9) Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
@maksadbek
maksadbek / tut6
Last active December 28, 2015 06:59
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim amount As Double = nudAmount.Value
Dim rate As Double = nudRate.Value
Dim year As Double = nudYear.Value
Dim result As Double = amount * (1 + rate / 100)